const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const path = require("path");
const webpack = require("webpack");

module.exports = merge(common, {
    mode: 'development', // 不压缩代码,加快编译速度
    devtool: 'cheap-module-eval-source-map', // 提供源码映射文件调试使用
    module: {
        rules: [
            {
                test: /\.css$/,
                exclude: /node_modules/,
                use: [
                    "style-loader",
                   
                    "css-loader",
                 
                ]
            },
            {
                test: /\.less$/,
                exclude: /node_modules/,
                use: [
                    "style-loader",
                   
                    "css-loader",
                  
                    "less-loader"
                ]
            },
        ]
    },
    devServer: {
        contentBase: 'public', // path.resolve(__dirname, "dist"),
        progress: true, // 打包过程中的打包进度条
        compress: true,
        open: true,
        port: 3000,
        hot:true
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
      
    ]

})